<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Doctor Signin</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            align-items: center;
            justify-content: center;
        }
        .signin-form {
            background-color: #fff;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
            max-width: 400px;
            width: 100%;
            text-align: center;
        }
        .signin-form h1 {
            margin-bottom: 1rem;
            color: #007BFF;
        }
        .signin-form label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: bold;
            color: #333;
        }
        .signin-form input {
            width: 100%;
            padding: 0.5rem;
            margin-bottom: 1rem;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
        .signin-form input[type="submit"] {
            background-color: #007BFF;
            color: #fff;
            border: none;
            cursor: pointer;
        }
        .signin-form input[type="submit"]:hover {
            background-color: #0056b3;
        }
        .signin-form p {
            margin-top: 1rem;
        }
        .back-to-main {
            display: inline-block;
            margin-top: 1rem;
            color: #007BFF;
            text-decoration: none;
            transition: color 0.3s;
        }
        .back-to-main:hover {
            color: #0056b3;
        }
        body.dark-mode {
            background-color: #121212;
            color: #ffffff;
        }
        .dark-mode .signin-form {
            background-color: #333;
            color: #fff;
        }
        .dark-mode .signin-form h1, .dark-mode .signin-form label, .dark-mode .signin-form p {
            color: #ffffff;
        }
        .dark-mode .signin-form input[type="submit"]:hover {
            background-color: #555;
        }
        .dark-mode .back-to-main, .dark-mode .back-to-main:hover {
            color: #ffffff;
        }
    </style>
</head>
<body>
    <div class="signin-form">
        <h1>Doctor Signin</h1>
        <form action="/doctor_signin" method="post">
            <label for="user_name">Username:</label>
            <input type="text" id="user_name" name="user_name" required><br>
            <label for="password">Password:</label>
            <input type="password" id="password" name="password" required><br>
            <input type="submit" value="Signin">
        </form>
        <p><a class="back-to-main" href="{{ url_for('main_page') }}">Back to Main Page</a></p>
        <button id="toggleDarkMode">Toggle Dark Mode</button>
    </div>
    <script>
        document.addEventListener('DOMContentLoaded', (event) => {
            const toggleDarkMode = document.getElementById("toggleDarkMode");

            if (localStorage.getItem('dark-mode') === 'true') {
                document.body.classList.add("dark-mode");
            }

            toggleDarkMode.addEventListener('click', () => {
                document.body.classList.toggle("dark-mode");
                localStorage.setItem('dark-mode', document.body.classList.contains("dark-mode"));
            });
        });
    </script>
</body>
</html>
